{% extends 'front/settle_pay/base_settle_pay.html' %}
{% block title %}支付{% endblock %}
{% block css %}
    {{ super() }}
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/pay.css') }}">
{% endblock %}

{% block main %}
    {#    orders是游标，只能循环一次得结果#}
    <div class="container">
        {% for order in orders %}
            <div class="go_pay">
                <div class="col-md-12 text-center">
                    <h3>支 付</h3>
                    <hr>
                </div>
                <div class="order col-md-offset-1 col-md-10">
                    <div class="left"><span>支付金额：</span><strong><span>{{ order['amount'] }}￥</span></strong></div>
                    <div class="order_no left"><span>订单号：</span><a
                            href="{{ url_for('orders.orderDetails', order_no=order['order_no']) }}">{{ order['order_no'] }}</a>
                    </div>
                </div>
                <div class="pay col-md-12 col-md-offset-1">
                    {% if orders %}
                        <div class="col-md-12">
                            <p>常用支付方式</p>
                            <ul class="left">
                                {% for image in images %}
                                    <li class="pay_img left">
                                        <label class="pay_label" onclick="pay_click()">
                                            <input class="pay_input" type="radio" name="pay" value="{{ image.name }}">
                                            <img src="data:;base64,{{ image.data | safe }}" alt={{ image.name }}/>
                                        </label>

                                    </li>
                                {% endfor %}
                            </ul>
                            <p><br></p>
                            <button class="btn left" onclick="pay_method_fun()">立即支付</button>
                        </div>
                        <div class="bank col-md-12">
                            <p>其他支付平台和银行</p>
                            <div class="bank_link">
                                <a href="{{ url_for('building.building') }}">建设银行</a>
                                <a href="{{ url_for('building.building') }}">中国银行</a>
                                <a href="{{ url_for('building.building') }}">农业银行</a>
                                <a href="{{ url_for('building.building') }}">中信银行</a>
                                <a href="{{ url_for('building.building') }}">广发银行</a>
                                <a href="{{ url_for('building.building') }}">中国工商银行</a>
                            </div>
                        </div>
                    {% endif %}
                </div>
                <div class="pay_QR">
                    <div class="graybox"></div>
                    <div class="popbox">
                        <div class="poptop">
                            <div class="pay_title text-center"><h4 id="pay_title_fun">支付宝扫码支付</h4></div>
                            <div class="pay_order_no"><span>订单号：</span><span>{{ order['order_no'] }}</span></div>
{#                            <a href="#" class="close"></a>#}
                        </div>
                        <div>
                            <div class="amount"><span>支付 <strong>{{ order['amount'] }}</strong>￥ 元</span></div>
                            <img id="pay_img_QR" src="/static/images/pay/zhifubao_payQR.png" alt="支付二维码">
                        </div>
                        <div>
                            <div>
                                <button class="close">取消支付</button>
                            </div>
                            <div>
                                <button class="success" onclick="to_orders('{{ order['order_no'] }}')">支付成功，请点击！
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
    <hr>
{% endblock %}

{% block js %}
    {{ super() }}
    <script src="{{ url_for('static', filename="js/pay.js") }}"></script>
{% endblock %}